﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Spelprojekt.Model
{
    public class Player 
    {
        public Vector2 m_position = new Vector2();        
        public Vector2 m_speed = new Vector2(1.5f);
        public Vector2 m_size = new Vector2(0.92f, 1.7f);  
     
        public static float m_size2 = 2;

        public float m_radius = m_size2 / 4;

        public bool m_isDead = false;

        public bool m_collideGround = true;        

        private PlayerState m_playerstate = PlayerState.Air;

        public PlayerState State
        {
            get { return m_playerstate; }
            set { m_playerstate = value; }
        }

        public Player()
        {
        }

        public Player(Vector2 a_pos)
        {
            m_position = a_pos;            
        }  
        
        public enum PlayerState
        {
            Dead,
            Win,
            Ground,
            Air,
            Finished
        }

        public bool doCollideFromWrongDirection(Enemy a_enemy)
        {
            float distance = a_enemy.m_radius + m_radius;

            if ((m_position - a_enemy.m_position).Length() < distance)
            {
                return true;
            }

            return false;
        }
    }
}
